package com.gitee.wsl.transform.format

import com.gitee.wsl.func.InvokeCall

//typealias ValueFormat<T> = (T)->String

fun interface Format<T>:InvokeCall<T,String>{
    fun format(base:T):String

    override fun invoke(t: T): String = format(t)

    companion object
}

typealias StringFormat = Format<String>

typealias DoubleFormat = Format<Double>

fun String.format(valueFormat: Format<String>) = valueFormat(this)

fun Float.print(format: Format<Double>) = toDouble().print(format)

fun Double.print(format: Format<Double>) = format(this)
